package com.example.broadcast.utils

import android.app.Activity

/**
 *@author cy
 *@date 2024/7/25
 *@apiNote
 */
object ActivityController {
    private val activities=ArrayList<Activity>()
    fun addActivity(activity: Activity){
        activities.add(activity)
    }
    fun removeActivity(activity: Activity){
        activities.remove(activity)
    }
    fun finishAll(){
        for (activity in activities) {
            if(!activity.isFinishing){
                activity.finish()
            }
        }
        activities.clear()
    }





}